/*
*/ 

#ifndef AGM_H
#define AGM_H

#include "obj3d.h"

#ifdef WIN32
#endif

/*file structure Version2:
AGMHeader
AGM_VERSION
XFRM_MAGIC
FRAM_MAGIC
agmXYZ
agmUV
agmXYZ
agmUV
agmXYZ
agmUV
...
FRAM_MAGIC
agmXYZ
agmUV
agmXYZ
agmUV
agmXYZ
agmUV
...

each frame must have same number of tris, 
but now point/tv-lists are irrelevant so tri-point linking can change each frame
*/



typedef struct 
{
    int ident;        // identifies as AGM header  (AGM1)
    int version;      // 2
    unsigned int numVtx;     // number of tris
    unsigned int numFrame;    // total number of frames
} AGMHeader;

typedef struct 
{
    float  tx,ty,tz;
    float  sx,sy,sz;
    float  ttu,ttv;
    float  stu,stv;
} agmXForm;


typedef struct 
{
    unsigned short  x,y,z,u,v;
} agmVtx;


typedef struct {
	agmVtx *currVtx;
	agmVtx *Vtx;
	float curFrame;
	int numFrame;
	int numVtx;
	vector scale;
	vector trans;
	vector scaletx;
	vector transtx;
} agmmodel; 

//prototypes
int load_agm(char *filename, agmmodel *obj);
void draw_agm(agmmodel *agm_model);
void free_agm(agmmodel *agm_model);
void UpdateAnim(agmmodel *agm_model); 


#endif
